﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EQ1.Elements;
using com.woodsoft.core;
using EQ1.Templates;
using com.woodsoft.core.Files;

namespace EQ1.Controls {
  public class Gauge :Control, IUIElement<Gauge>{
    public Gauge ( UIDocument doc , string name ) : base( doc , name ) {
      this.TextOffsetX = 0;
      this.TextOffsetY = 0;
      this.GaugeOffsetX = 0;
      this.GaugeOffsetY = 16;
    }
    public Gauge ( UIDocument doc ) : this( doc , "Gauge" ) {
    }

    #region IUIElement<Gauge> Members

    public void Validate ( Gauge val , string name ) {
      throw new NotImplementedException();
    }
    public void Copy ( Gauge val ) {
      throw new NotImplementedException();
    }

    #endregion
 
    public int TextOffsetX {
      get {
        return int.Parse( this.GetElement( "TextOffsetX" ).InnerText );
      }
      set {
        this.Validate( "TextOffsetX" , value.ToString() );
      }
    }
    public int TextOffsetY {
      get {
        return int.Parse( this.GetElement( "TextOffsetY" ).InnerText );
      }
      set {
        this.Validate( "TextOffsetY" , value.ToString() );
      }
    }
    public int GaugeOffsetX {
      get {
        return int.Parse( this.GetElement( "GaugeOffsetX" ).InnerText );
      }
      set {
        this.Validate( "GaugeOffsetX" , value.ToString() );
      }
    }
    public int GaugeOffsetY {
      get {
        return int.Parse( this.GetElement( "GaugeOffsetY" ).InnerText );
      }
      set {
        this.Validate( "GaugeOffsetY" , value.ToString() );
      }
    }

    public GaugeDrawTemplate GaugeDrawTemplate {
      get {
        return ( GaugeDrawTemplate ) this.GetElement( "GaugeDrawTemplate" );
      }
      set {
        this.GaugeDrawTemplate.Validate( value , "GaugeDrawTemplate" );
      }
    }
    public RGB FillTint {
      get {
        return ( RGB ) this.GetElement( "LinesFillTint" );
      }
      set {
        this.LinesFillTint.Validate( value , "LinesFillTint" );
      }
    }
    public bool DrawLinesFill {
      get {
        return bool.Parse( this.GetElement( "DrawLinesFill" ).InnerText );
      }
      set {
        this.Validate( "DrawLinesFill" , value.ToString() );
      }
    }
    public RGB LinesFillTint {
      get {
        return ( RGB ) this.GetElement( "LinesFillTint" );
      }
      set {
        this.LinesFillTint.Validate( value , "LinesFillTint" );
      }
    }
  }
}
